// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_prot;

import android.content.Context;
import android.text.TextUtils;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_pr.p_a.cls_q;
import com.nnee.p_pr.p_a.cls_u;
import com.nnee.p_pr.p_b.cls_a;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class cls_e
{

    public cls_e()
    {
    }

    private static String a(int i)
    {
        String s = null;
        i;
        JVM INSTR tableswitch 1 3: default 28
    //                   1 30
    //                   2 36
    //                   3 42;
           goto _L1 _L2 _L3 _L4
_L1:
        return s;
_L2:
        s = "baidu";
        continue; /* Loop/switch isn't completed */
_L3:
        s = "wikipedia";
        continue; /* Loop/switch isn't completed */
_L4:
        s = "youdao";
        if(true) goto _L1; else goto _L5
_L5:
    }

    public static String a(Context context, String s)
    {
        String s1;
        if(TextUtils.isEmpty(s))
        {
            s1 = null;
        } else
        {
            cls_m m1 = new cls_m("http://dict.youdao.com/dp/fy");
            m1.a("i", s);
            m1.a("keyfrom", "com.nnee.p_pr");
            m1.a("vendor", "yuedu");
            m1.a("imei", u.g(context));
            m1.a("mid", q.b());
            m1.a("model", u.b());
            m1.a();
            s1 = m1.b();
        }
        return s1;
    }

    public static String a(String s)
    {
        return a(s, 0);
    }

    public static String a(String s, int i)
    {
        String s1 = com.nnee.p_pr.p_b.cls_a.N();
        if(s1 == null) goto _L2; else goto _L1
_L1:
        String s2;
        String s5;
        if(s1.startsWith("/"))
            s2 = (new StringBuilder()).append("http://easyread.163.com").append(s1).toString();
        else
        if(!s1.startsWith("http://"))
            s2 = (new StringBuilder()).append("http://").append(s1).toString();
        else
            s2 = s1;
        s5 = s2.replace("{searchTerms}", URLEncoder.encode(s, "utf-8"));
        s1 = s5;
_L3:
        if(i > 0 && i <= 3)
        {
            String s3 = a(i);
            UnsupportedEncodingException unsupportedencodingexception;
            String s4;
            if(s1.indexOf('?') >= 0)
                s4 = (new StringBuilder()).append(s1).append('&').toString();
            else
                s4 = (new StringBuilder()).append(s1).append('?').toString();
            s1 = (new StringBuilder()).append(s4).append("from=").append(s3).toString();
        }
_L2:
        return s1;
        unsupportedencodingexception;
        unsupportedencodingexception.printStackTrace();
        s1 = s2;
          goto _L3
    }

    private static boolean b(String s)
    {
        boolean flag;
label0:
        {
            flag = false;
            if(s == null)
                break label0;
            for(int i = ((flag) ? 1 : 0); i < s.length(); i++)
            {
                char c1 = s.charAt(i);
                if((c1 < 'a' || c1 > 'z') && (c1 < 'A' || c1 > 'Z') && c1 != '-')
                    break label0;
            }

            flag = true;
        }
        return flag;
    }

    public static final int a = 0;
    public static final int b = 1;
    public static final int c = 2;
    public static final int d = 3;
}
